<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>获取积分</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <link href="../demo.css" rel="stylesheet" type="text/css" />
    <script src="../../scripts/boot.js" type="text/javascript"></script>
    <style type="text/css">
    html,body
    {
        width:100%;
        height:100%;
        border:0;
        margin:0;
        padding:0;
        overflow:visible;
    }
    </style>
</head>
<body >   
	  <div class="mini-toolbar" style="border:0;">
        <table style="width:100%;">
            <tr>
            <td style="width:100%;">
                 <!--  <a class="mini-button" iconCls="icon-add" onclick="newRow();" plain="true">会员增减积分</a>
                  <span class="separator"></span> -->
                  <a class="mini-button" iconCls="icon-download"  onclick="downloadData()"  plain="true">数据下载</a>
                  <a class="mini-button" iconCls="icon-reload" plain="true" onclick="search();">刷新</a>
             </td>
             <td style="white-space:nowrap;">
             	 <label style="font-family:Verdana;">时间: </label>
                 <input id="datebegin" class="mini-datepicker" format="yyyy-MM-dd HH" timeFormat="HH" showTime="true"  />~<input id="dateend" class="mini-datepicker" format="yyyy-MM-dd HH" timeFormat="HH" showTime="true"/>
                 <label style="font-family:Verdana;">用户ID: </label>
                 <input id="key" class="mini-textbox"/>
                  <label style="font-family:Verdana;" >IP:</label>
                <input class="mini-textbox" id="ip" />
                 <a class="mini-button" iconCls="icon-search" plain="true" onclick="search();">查询</a>
             </td>
            </tr>
        </table>
    </div>
    <!--撑满页面-->
    <div class="mini-fit">
        <div id="datagrid1" class="mini-datagrid" style="width:100%;height:100%;" 
            url="/ios/pages/ObtainIntegral/list.do"  idField="id" sizeList="[5,10,20,50]" pageSize="20"
               multiSelect="true" allowCellValid="true" oncellvalidation="onCellValidation" cellclick="mytest" >
            <div property="columns">
                <div type="indexcolumn" width="20"></div>
                <div type="checkcolumn"></div>
                <div field="userid"   headerAlign="center" allowSort="true" >用户ID</div>
                <div field="username"   headerAlign="center" allowSort="true" >用户昵称</div>
                <div field="number"  headerAlign="center"  allowSort="true">平台获得积分</div>
                 <div field="fnumber"  headerAlign="center"  allowSort="true">用户积分</div>
                <div field="crdate" headerAlign="center"  allowSort="true">时间</div>
                <div field="type"  headerAlign="center"  renderer="onTypeRenderer" >类型</div>
                <div field="remark" headerAlign="center"  allowSort="true">备注</div>
                 <div field="appName" headerAlign="center"  allowSort="true">appName</div>
                 <div field="IP"  headerAlign="center" allowSort="true" >IP</div>
                     <div field="version"  headerAlign="center" allowSort="true" >版本号</div>
            </div>
        </div> 
    </div>
    
    <script type="text/javascript">
        var type = [{ id: 1, text: '获取' }, { id: 2, text: '管理员增减'},{ id: 3, text: '邀请送积分'},{ id: 5, text: '分享奖励'},{ id: 6, text: 'vip奖励'}];
        mini.parse();
        var grid = mini.get("datagrid1");
        grid.load();
        function onTypeRenderer(e){
            for (var i = 0, l = type.length; i < l; i++) {
                var g = type[i]; if (g.id == e.value) return g.text;
            }
            return "";
        }
        function search(){
           var datebegin = mini.get("datebegin").getFormValue();
           var dateend = mini.get("dateend").getFormValue();
           var key = mini.get("key").getValue();
           var IP = mini.get("ip").getValue();
           grid.load({userid:key,crdatebegin:datebegin,crdateend:dateend,IP:IP});
           grid.clearSelect();
        }
        
        function downloadData(){
           var datebegin = mini.get("datebegin").getFormValue();
           var dateend = mini.get("dateend").getFormValue();
           var key = mini.get("key").getValue();
           var IP = mini.get("ip").getValue();
           var url="/ios/pages/ObtainIntegral/exportData.do?userid="+key+"&crdatebegin="+datebegin+"&crdateend="+dateend+"&IP="+IP;
           window.location.href=url;
        }
    </script>
</body>
</html>

